#!/usr/bin/env bash

d=`date "+%Y%m%d%H%M"`

echo $d
echo '----------------开始备份suneee-cloud--------------'
mv /opt/tomcat-suneee-cloud/webapps/ROOT /opt/tomcat-suneee-cloud/backup/ROOT.$d

echo '----------------拷贝后台工程--------------------------------------'
mkdir -p /opt/tomcat-suneee-cloud/webapps/ROOT/WEB-INF
mkdir -p /opt/tomcat-suneee-cloud/webapps/ROOT/META-INF

cp -R /opt/tomcat-suneee-cloud/backup/ROOT.$d/WEB-INF/* /opt/tomcat-suneee-cloud/webapps/ROOT/WEB-INF
cp -R /opt/tomcat-suneee-cloud/backup/ROOT.$d/META-INF/* /opt/tomcat-suneee-cloud/webapps/ROOT/META-INF

echo '----------------拷贝前端项目到工程目录下--------------------------'
mv /opt/tomcat-suneee-cloud/front/dist/* /opt/tomcat-suneee-cloud/webapps/ROOT

echo '-------------成功---------------'
